m = 0
for i in range(1,5):
    for j in range(1,5):
        for k in range(1,5):
            if(i!=k) and (i!=j) and (k!=j):
                print(i,j,k)
                m = m+1
print("一共有"+str(m)+"个三位数")
